<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
        <script src="./lib/vue.js"></script>
    </head>
    <body>
        <div id="app">
            数值A: <input type="text" v-model="a" /> <br />
            数值B: <input type="text" v-model="b" /> <br />
            <button v-on:click="count">计算</button>
            <div>计算结果：<span v-text="result"></span></div>
        </div>
        <script>
            var app = new Vue({
                el: '#app',
                data: {
                    a: '',
                    b: '',
                    result: ''
                },
                methods: {
                    count: function() {
                        this.result = Number(this.a) + Number(this.b);
                    }
                }
            });
        </script>
    </body>
</html>
